layui.define(['jquery'],function(exports){
	var $ = layui.$
	,time = 10
	,sendSmsUrl='/Member/sendSms'
	,obj = {
		
    	ex: function(time,url){
			console.log('HelloWorld!');
		}
		
		,getQueryString : function(name,value){
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			var q = window.location.pathname.substr(1).match(reg_rewrite);
			if(r != null){
				return unescape(r[2]);
			}else if(q != null){
				return unescape(q[2]);
			}else{
				return value;
			}
		}
		
		,sendSms : function(){
			if(--time>=0){
				$("#smsbtn").addClass('layui-btn-disabled');
				$("#smsbtn").attr('disabled',true);
				$("#smsbtn").text('重新发送！');
				interval = setTimeout(obj.sendSms,1000);
				$("#smsbtn").text(time+'s后再次发送',false);
			}else{
				$("#smsbtn").attr('disabled',false);
				$("#smsbtn").removeClass('layui-btn-disabled');
				$("#smsbtn").text('发送短信验证码',false);
				time=10;
				clearInterval(interval);
			}
		}
		
	};
	exports('functions', obj);
});    

//js一般函数库